﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Office.OneNote
{
    [OneNoteXmlElement("Outline")]
    public sealed class OneNoteOutline : OneNotePageObject
    {
        internal static readonly OneNoteProperty AuthorProperty = OneNoteProperty.Register(
            "author", typeof(String), typeof(OneNoteOutline));

        internal static readonly OneNoteProperty SizeProperty = OneNoteProperty.Register(
            "Size", typeof(OneNoteOutlineSize), typeof(OneNoteOutline));

        internal static readonly OneNoteProperty PositionProperty = OneNoteProperty.Register(
            "Position", typeof(OneNoteOutlinePosition), typeof(OneNoteOutline));

        internal static readonly OneNoteProperty OEChildrenProperty = 
            OEChildren.RegisterProperty<OneNoteOutline>();

        internal OneNoteOutline(OneNoteObjectId id)
            : base (id)
        {
        }

        public String Author
        {
            get { return GetValue<String>(AuthorProperty); }
            set { SetValue(AuthorProperty, value); }
        }

        public OneNoteOutlineSize Size
        {
            get { return GetValue<OneNoteOutlineSize>(SizeProperty); }
            set { SetValue(SizeProperty, value); }
        }

        public OneNoteOutlinePosition Position
        {
            get { return GetValue<OneNoteOutlinePosition>(PositionProperty); }
            set { SetValue(PositionProperty, value); }
        }

        public OneNoteObjectCollection<OneNoteOutlineElement> Elements
        {
            get
            {
                return GetValue<OEChildren>(OEChildrenProperty).OutlineElements;
            }
        }
    }
}
